/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidade;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Lomanda
 */
@Entity
@Table(name = "tbrequisicaostock")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "RequisicaoStock.findAll", query = "SELECT r FROM RequisicaoStock r"),
    @NamedQuery(name = "RequisicaoStock.findById", query = "SELECT r FROM RequisicaoStock r WHERE r.id = :id"),
    @NamedQuery(name = "RequisicaoStock.findByDataRequisicao", query = "SELECT r FROM RequisicaoStock r WHERE r.dataRequisicao = :dataRequisicao"),
    @NamedQuery(name = "RequisicaoStock.findByDataSaida", query = "SELECT r FROM RequisicaoStock r WHERE r.dataSaida = :dataSaida"),
    @NamedQuery(name = "RequisicaoStock.findByFkFuncionario", query = "SELECT r FROM RequisicaoStock r WHERE r.fkFuncionario = :fkFuncionario")})
public class RequisicaoStock implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Column(name = "dataRequisicao")
    @Temporal(TemporalType.DATE)
    private Date dataRequisicao;
    @Column(name = "dataSaida")
    @Temporal(TemporalType.DATE)
    private Date dataSaida;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "fkFuncionario")
    private String fkFuncionario;
    @JoinColumn(name = "fkHistorico", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private HistoricoStock fkHistorico;

    public RequisicaoStock() {
    }

    public RequisicaoStock(Integer id) {
        this.id = id;
    }

    public RequisicaoStock(Integer id, Date dataRequisicao, String fkFuncionario) {
        this.id = id;
        this.dataRequisicao = dataRequisicao;
        this.fkFuncionario = fkFuncionario;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getDataRequisicao() {
        return dataRequisicao;
    }

    public void setDataRequisicao(Date dataRequisicao) {
        this.dataRequisicao = dataRequisicao;
    }

    public Date getDataSaida() {
        return dataSaida;
    }

    public void setDataSaida(Date dataSaida) {
        this.dataSaida = dataSaida;
    }

    public String getFkFuncionario() {
        return fkFuncionario;
    }

    public void setFkFuncionario(String fkFuncionario) {
        this.fkFuncionario = fkFuncionario;
    }

    public HistoricoStock getFkHistorico() {
        return fkHistorico;
    }

    public void setFkHistorico(HistoricoStock fkHistorico) {
        this.fkHistorico = fkHistorico;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RequisicaoStock)) {
            return false;
        }
        RequisicaoStock other = (RequisicaoStock) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidade.RequisicaoStock[ id=" + id + " ]";
    }
    
}
